/*
 * XML Type:  PresentmentList
 * Namespace: http://ofx.net/types/2003/04
 * Java type: net.ofx.types.x2003.x04.PresentmentList
 *
 * Automatically generated - do not modify.
 */
package net.ofx.types.x2003.x04.impl;
/**
 * An XML PresentmentList(@http://ofx.net/types/2003/04).
 *
 * This is a complex type.
 */
public class PresentmentListImpl extends org.apache.xmlbeans.impl.values.XmlComplexContentImpl implements net.ofx.types.x2003.x04.PresentmentList
{
    
    public PresentmentListImpl(org.apache.xmlbeans.SchemaType sType)
    {
        super(sType);
    }
    
    private static final javax.xml.namespace.QName PRESBILLINFO$0 = 
        new javax.xml.namespace.QName("", "PRESBILLINFO");
    
    
    /**
     * Gets array of all "PRESBILLINFO" elements
     */
    public net.ofx.types.x2003.x04.PresentmentBillInfo[] getPRESBILLINFOArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            java.util.List targetList = new java.util.ArrayList();
            get_store().find_all_element_users(PRESBILLINFO$0, targetList);
            net.ofx.types.x2003.x04.PresentmentBillInfo[] result = new net.ofx.types.x2003.x04.PresentmentBillInfo[targetList.size()];
            targetList.toArray(result);
            return result;
        }
    }
    
    /**
     * Gets ith "PRESBILLINFO" element
     */
    public net.ofx.types.x2003.x04.PresentmentBillInfo getPRESBILLINFOArray(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.PresentmentBillInfo target = null;
            target = (net.ofx.types.x2003.x04.PresentmentBillInfo)get_store().find_element_user(PRESBILLINFO$0, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            return target;
        }
    }
    
    /**
     * Returns number of "PRESBILLINFO" element
     */
    public int sizeOfPRESBILLINFOArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(PRESBILLINFO$0);
        }
    }
    
    /**
     * Sets array of all "PRESBILLINFO" element
     */
    public void setPRESBILLINFOArray(net.ofx.types.x2003.x04.PresentmentBillInfo[] presbillinfoArray)
    {
        synchronized (monitor())
        {
            check_orphaned();
            arraySetterHelper(presbillinfoArray, PRESBILLINFO$0);
        }
    }
    
    /**
     * Sets ith "PRESBILLINFO" element
     */
    public void setPRESBILLINFOArray(int i, net.ofx.types.x2003.x04.PresentmentBillInfo presbillinfo)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.PresentmentBillInfo target = null;
            target = (net.ofx.types.x2003.x04.PresentmentBillInfo)get_store().find_element_user(PRESBILLINFO$0, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            target.set(presbillinfo);
        }
    }
    
    /**
     * Inserts and returns a new empty value (as xml) as the ith "PRESBILLINFO" element
     */
    public net.ofx.types.x2003.x04.PresentmentBillInfo insertNewPRESBILLINFO(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.PresentmentBillInfo target = null;
            target = (net.ofx.types.x2003.x04.PresentmentBillInfo)get_store().insert_element_user(PRESBILLINFO$0, i);
            return target;
        }
    }
    
    /**
     * Appends and returns a new empty value (as xml) as the last "PRESBILLINFO" element
     */
    public net.ofx.types.x2003.x04.PresentmentBillInfo addNewPRESBILLINFO()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.PresentmentBillInfo target = null;
            target = (net.ofx.types.x2003.x04.PresentmentBillInfo)get_store().add_element_user(PRESBILLINFO$0);
            return target;
        }
    }
    
    /**
     * Removes the ith "PRESBILLINFO" element
     */
    public void removePRESBILLINFO(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(PRESBILLINFO$0, i);
        }
    }
}
